package com.example.testhotload;

import retrofit.GsonConverterFactory;
import retrofit.Retrofit;
import retrofit.RxJavaCallAdapterFactory;

public class ServiceFactory {
    private static final String BASEURL ="http://192.168.1.150:3000/";
    public static<T> T createServiceFrom(final Class<T> serviceClass){
        Retrofit adapter = new Retrofit.Builder()
                .baseUrl(BASEURL)
                .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
                .addConverterFactory(GsonConverterFactory.create())
                .build();

        return adapter.create(serviceClass);
    }
}
